Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use currency decimals for surplus amount calculation #3000

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

shoom3301
Copy link
Collaborator

Summary

Fixes #2995

The source of problem: Number(surplusAmount.toFixed(3)) > MIN_SURPLUS_UNITS
EURs token has 2 decimals:
invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')

@shoom3301 shoom3301 requested review from a team August 3, 2023 14:51
@vercel
Copy link

vercel bot commented Aug 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
swap-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2023 2:57pm

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No crash now!

@shoom3301 shoom3301 changed the base branch from main to release/1.44-rc1 August 4, 2023 08:37
@shoom3301 shoom3301 merged commit 1432b6d into release/1.44-rc1 Aug 4, 2023
13 of 14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 4, 2023
@alfetopito alfetopito deleted the fix-surpus-decimals branch August 4, 2023 08:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants